package com.github.microwww.upms.vo;

import com.github.microwww.upms.domain.*;
import java.util.*;
import java.util.stream.Collectors;

public abstract class WebappValue {

    public static class Simple extends AbstractDomainValue<Webapp> {

        public Simple(Webapp domain) {
            super(domain);
        }

        public Date getCreateTime() {
            return super.domain.getCreateTime();
        }

        public int getId() {
            return super.domain.getId();
        }

        public String getUrl() {
            return super.domain.getUrl();
        }
    }

    public static class Info extends Simple {

        public Info(Webapp domain) {
            super(domain);
        }
    }

    public static class More extends Info {

        public More(Webapp domain) {
            super(domain);
        }

        public List<RoleValue.Simple> getRoles() {
            List<Role> list = super.domain.getRoles();
            return list.stream().map(RoleValue.Simple::new).collect(Collectors.toList());
        }

        public List<WebUrlValue.Simple> getWebUrls() {
            List<WebUrl> list = super.domain.getWebUrls();
            return list.stream().map(WebUrlValue.Simple::new).collect(Collectors.toList());
        }

        public List<WebappUserValue.Simple> getWebappUsers() {
            List<WebappUser> list = super.domain.getWebappUsers();
            return list.stream().map(WebappUserValue.Simple::new).collect(Collectors.toList());
        }
    }
}
